<?php

namespace App\Admin\Controllers;

use Dcat\Admin\Layout\Row;
use Dcat\Admin\Layout\Column;
use Dcat\Admin\Layout\Content;
use App\Admin\Metrics\YearTickets;
use App\Admin\Metrics\MonthTickets;
use App\Http\Controllers\Controller;
use App\Admin\Metrics\YearTicketsWithFinish;
use App\Admin\Metrics\MonthTicketsWithFinish;
use App\Admin\Metrics\YearTicketsWithUnFinish;
use App\Admin\Metrics\MonthTicketsWithUnFinish;

class HomeController extends Controller
{
    public function index(Content $content)
    {
        return $content
            ->header('数据中心')
            // ->description('Description...')
            ->body(function (Row $row) {
                $row->column(4, function (Column $column) {
                    $column->row(new MonthTickets());
                    $column->row(new YearTickets());
                });
                $row->column(4, function (Column $column) {
                    // $column->row(Dashboard::title());
                    $column->row(new MonthTicketsWithFinish());
                    $column->row(new YearTicketsWithFinish());
                });
                $row->column(4, function (Column $column) {
                    // $column->row(Dashboard::title());
                    $column->row(new MonthTicketsWithUnFinish());
                    $column->row(new YearTicketsWithUnFinish());
                });
            });
    }
}
